package com.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dao.MajorDao;
import com.dao.MajortypeDao;
import com.pojo.Majortype;
import org.springframework.stereotype.Service;

@Service
public class MajortypeService extends ServiceImpl<MajortypeDao, Majortype> {
    /**
     * 分页查询专业
     * @param page
     * @param limit
     * @return
     */
    public IPage types(Integer page ,Integer limit, String key){
        QueryWrapper query = new QueryWrapper();
        if(key != null){
            query.like("mtname",key);
        }
        IPage iPage = page(new Page<>(page,limit),query);
        return iPage;
    }
}
